//
//  UIView+Add.m
//  PigMarket
//
//  Created by Felix on 2019/3/22.
//  Copyright © 2019 felix.pigmarket.oc. All rights reserved.
//

#import "UIView+Add.h"

@implementation UIView (Add)

- (void)setupRoundedRect:(CGRect)rect byRoundingCorners:(UIRectCorner)rectCorner cornerRadii:(CGSize)cornerRadii {
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:rectCorner cornerRadii:cornerRadii];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = rect;
    maskLayer.path = maskPath.CGPath;
    self.layer.mask = maskLayer;
}

@end
